#include<vector>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<queue>
using namespace std;

class Solution {

public:
    string destCity(vector<vector<string>>& paths) {
        unordered_map<string, int> degree;
        for (auto& path : paths) {
            ++ degree[path[0]];
            if (degree.find(path[1]) == degree.end())
                degree[path[1]] = 0;
        }
        string res = "";
        for (auto& it : degree) {
            if (it.second == 0) {
                res = it.first;
            }
        }
        return res;
    }
};